<template>
	<view class="pages">
		<view class="t-c f-40 f-bold p-y-30">{{news.title}}</view>
		<view class="t-c m-b-30 col-6">{{news.time}}</view>
		<u-parse :content="news.content"></u-parse>
	</view>
</template>

<script>
	import {
		getNewsInfoDetail
	} from '@/api/detail.js'
	export default {
		onLoad(options) {
			if (!options || !options.id) {
				return uni.navigateBack()
			}
			this.getNewsInfo(options.id)
		},
		data() {
			return {
				news: {},
			}
		},
		methods: {
			async getNewsInfo(id) {
				const res = await getNewsInfoDetail(id)
				if (res.code === 200) {
					this.news = res.data
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.pages {
		padding: 0 30rpx 60rpx;
	}
</style>
